#ifndef NF_SOCS_NEIGH_H
#define NF_SOCS_NEIGH_H
#include <linux/list.h>
#include <linux/in.h>
#include <stdbool.h>
#include "socs/mod/localnode.h"
#include "socs/mod/sap.h"
#include "socs/mod/addr_opt.h"
#include "socs/comm/types.h"

#define INITVAL_32   0x9e370001UL


struct socs_neigh_node {
	struct list_head list_hook;
	int is_localnode;
	struct localnode lcn;
	/*this member has the zero array,so need to been the last one*/
};
int socs_neigh_expire_now(struct socs_neigh_node *neigh);
void socs_neigh_expire(unsigned long data);
unsigned int socs_neigh_hash(void *src, void *dest, unsigned int totallink,
							 int family);

int socs_neigh_find_by_addr(void *src, void *dest, int family, int inner_family,
							int *is_localnode, socs_addr_t *dIP);

int socs_neigh_find_by_hostname(const char *hostname, int family, socs_addr_t *dIP);

int socs_neigh_getlcl_unequal(int family, const char *ifname,
							  struct locallink *lcl);

int socs_neigh_localnode_up(struct net_device *dev);
int socs_neigh_localnode_down(const char *ifname);
int socs_neigh_send_localnode(void);
int socs_neigh_recv_basic(struct hello_packet *hello);
int socs_neigh_localnode_ip_down(const char *ifname, void *address, int family);
int socs_neigh_remove(void
					  *address);/* the node  expire will call this function*/
void socs_neigh_destroy(void);
struct list_head *socs_neigh_get(int family);
void socs_neigh_show(int family);
int  socs_neigh_init(void);
int socs_neigh_vote(struct sap_table *saptb);
void socs_neigh_read_lock(int family);
void socs_neigh_read_unlock(int family);

#endif
